#define _CRT_SECURE_NO_WARNINGS  1
#include<stdio.h>
#include<string.h>
char* my_strstr(char* arr1, char* arr2)
{	
	char* p1 = arr1;
	char* p2 = arr2;
	while (*arr1 != '\0')
	{
		while (*arr1 == *arr2)
		{
			arr1++;
			arr2++;
			if (*arr2 == '\0')
			{
				return p1;
			}
		}
		arr2 = p2;
		arr1 = p1 + 1;
		p1++;
	}
	return NULL;
}
char* my_strtok(char* cp, char* sep)
{
	static char* cp1;
	static char* sep1;
	if (cp == NULL)
	{
		cp = cp1;
		sep = sep1;
	}
	char* p1 = cp;
	while (*cp != *sep)
	{
		cp++;
	}
	*cp = '\0';
	cp1 = cp + 1;
	sep1 = sep + 1;
	return p1;
}
int main()
{
	char arr1[] = "zjy";
	char arr2[] = "nbzjy";
	char* a = strstr(arr2, arr1);
	char* b = my_strstr(arr2, arr1);
	printf("%s\n", a);
	printf("%s\n", b);
	char email[] = "2387828989@qq.com";
	char* c = "@.";
	char* d = strtok(email, c);
	printf("%s\n", d);
	char* e = strtok(NULL, c);
	printf("%s\n", e); 
	char email1[] = "2387828989@qq.com";
	char* c1 = "@.";
	char* f = my_strtok(email1, c1);
	printf("%s\n", f);
	char* g = my_strtok(NULL, c1);
	printf("%s\n", g);
	return 0;
}